package com.ljf.controller;

import com.ljf.annotation.HasPermission;
import com.ljf.dto.DetailStorageSituationDto;
import com.ljf.dto.StorageSituationPageDto;
import com.ljf.service.GoodsService;
import com.ljf.service.GoodsStoreService;
import com.ljf.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@Validated
@RequestMapping("/inventory_management/store/storage_situation")
public class StorageSituationController {
    @Autowired
    private GoodsStoreService goodsStoreService;
    @HasPermission("inventory_management:store:storage_situation")
    @PostMapping("/queryPageByQo")
    public Result pageQuery(StorageSituationPageDto dto) {
        Map<String, Object> map = goodsStoreService.pageQuery(dto);
        return Result.success(map);

    }
    @HasPermission("inventory_management:store:storage_situation")
    @PostMapping("/queryStoreGoodsByStoreId")
    public Result queryStoreGoodsByStoreId(DetailStorageSituationDto dto) {
        Map<String, Object> map = goodsStoreService.queryStoreGoodsByStoreId(dto);
        return Result.success(map);

    }
}
